const path = require('path');

module.exports = (env)=>{
  console.log("env : ",env);
  console.log('NODE_ENV: ',env.NODE_ENV);
  console.log('Production: ', env.production);

  return {
    mode: "development",
    devtool: "inline-source-map",
    entry: './src/index.ts',
    module: {
      rules: [
        {
          test: /\.tsx?$/,
          use: 'ts-loader',
          exclude: /node_modules/,
        },
      ],
    },
    resolve: {
      extensions: ['.tsx', '.ts', '.js'],
    },
    output: {
      filename: 'webpack-numbers.js',
      path: path.resolve(__dirname, 'dist'),
      clean: true
    },
    externals: {
      lodash: 'lodash',
    }
  }
};